<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新文章发布</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f7fa;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .container {
            background-color: #ffffff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 800px;
            margin-top: 50px;
        }

        h1 {
            font-size: 28px;
            color: #2c3e50;
            text-align: center;
            margin-bottom: 30px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .message {
            color: green;
            text-align: center;
            margin-bottom: 20px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            font-size: 16px;
            color: #555;
            margin-bottom: 8px;
        }

        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 5px;
            background-color: #f9f9f9;
            transition: border-color 0.3s ease;
        }

        .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
            border-color: #3498db;
            outline: none;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 120px;
        }

        button {
            padding: 12px 25px;
            font-size: 18px;
            color: white;
            background-color: #3498db;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.3s ease;
            width: 100%;
        }

        button:hover {
            background-color: #2980b9;
            transform: translateY(-3px);
        }

        button:active {
            background-color: #1abc9c;
            transform: translateY(0);
        }

        /* 媒体查询：适应小屏幕 */
        @media (max-width: 768px) {
            .container {
                padding: 20px;
            }

            h1 {
                font-size: 24px;
            }

            .form-group input, .form-group select, .form-group textarea {
                font-size: 14px;
            }

            button {
                font-size: 16px;
                padding: 10px 20px;
            }
        }
    </style>
</head>
<body>

<div class="container">
    <h1>新文章发布</h1>



    <!-- 新文章发布表单 -->
    <form method="POST" action="/admin/articles" enctype="multipart/form-data">
        <div class="form-group">
            <label for="title">文章标题:</label>
            <input type="text" id="title" name="title" required />
        </div>

        <div class="form-group">
            <label for="abstractText">文章摘要:</label>
            <textarea id="abstractText" name="abstractText" required></textarea>
        </div>

        <div class="form-group">
            <label for="content">文章内容:</label>
            <textarea id="content" name="content" required></textarea>
        </div>

        <div class="form-group">
            <label for="attachmentFile">上传附件 (PDF):</label>
            <input type="file" id="attachmentFile" name="attachmentFile" accept=".pdf" />
        </div>

        <div class="form-group">
            <label for="publishDate">发布日期:</label>
            <!-- 使用HTML5的datetime-local类型输入框 -->
            <input type="datetime-local" id="publishDate" name="publishDate" required />
        </div>

        <div class="form-group">
            <button type="submit">保存并发布</button>
        </div>
    </form>
</div>

</body>
</html>
